{extend name="base" /}
{block name="body"}
<div class="layui-body">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class="layui-this">基本设置</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <form class="layui-form form-container" action="{:url('admin/Parameter/upd')}" method="post" enctype="multipart/form-data">
                    <div class="layui-form-item">
                        <label class="layui-form-label">投票状态</label>
                        <div class="layui-input-block">
                            <if >

                            </if>
                            <input type="radio" name="voteStatus" value="1" title="开启" <?php if($picture['voteStatus']=='1') echo " checked"; ?>>
                            <input type="radio" name="voteStatus" value="0" title="关闭" <?php if($picture['voteStatus']=='0') echo " checked=\"checked\""; ?>>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">投票审核</label>
                        <div class="layui-input-block">
                            <input type="radio" name="checkStatus" value="1" title="自动审核"<?php if($picture['checkStatus']=='1') echo"checked"; ?>>
                            <input type="radio" name="checkStatus" value="0" title="人工审核" <?php if($picture['checkStatus']=='0') echo"checked"; ?>>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">活动标题</label>
                        <div class="layui-input-block">
                            <input type="text" name="voteTitle" value="{$picture.voteTitle}" placeholder="请输入活动标题" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">活动要求图</label>
                        <div class="layui-input-block">
                            <input type="text" name="introducePic" value="{$picture['introducePic']}" placeholder="请上传图片" class="layui-input layui-input-inline" id="thumbPics">
                            <input type="file" name="file" class="layui-upload-files">
                        </div>
                        <div style="margin-top:-50px;margin-left:430px">
                            <img src="/public/{$picture.introducePic}" id="previewd" style="width: 100px;height: 100px;"/>
                        </div>
                    </div>

                    <!--<div class="layui-form-item">-->
                    <!--<label class="layui-form-label">关键词回复</label>-->
                    <!--<div class="layui-input-block">-->
                    <!--<textarea name="keyWord" placeholder="请输入关键词" id="description" class="layui-textarea">{$picture.keyWord}</textarea>-->
                    <!--</div>-->
                    <!--</div>-->
                    <!--<div class="layui-form-item">-->
                    <!--<label class="layui-form-label">图文缩略图</label>-->
                    <!--<div class="layui-input-block">-->
                    <!--<input type="text" name="pic" value="{$picture.pic}" placeholder="请上传图片" class="layui-input layui-input-inline" id="thumb">-->
                    <!--<input type="file" name="file" class="layui-upload-file">-->
                    <!--</div>-->
                    <!--<div style="margin-top:-50px;margin-left:430px">-->
                    <!--<img src="/public/{$picture.pic}" id="preview" style="width: 100px;height: 100px;"/>-->
                    <!--</div>-->
                    <!--</div>-->
                    <!--<div class="layui-form-item">-->
                    <!--<label class="layui-form-label">活动介绍</label>-->
                    <!--<div class="layui-input-block">-->
                    <!--<textarea name="voteDesc" placeholder="请输入活动介绍" id="content" class="layui-textarea">{$picture.voteDesc}</textarea>-->
                    <!--&lt;!&ndash;<textarea name="voteRule" placeholder="" class="layui-textarea" id="content"></textarea>&ndash;&gt;-->
                    <!--</div>-->
                    <!--</div>-->
                    <div class="layui-form-item">
                        <label class="layui-form-label">背景音乐</label>
                        <div class="layui-input-block">
                            <input type="text" name="backMusic" value="{$picture.backMusic}" class="layui-input layui-input-inline" id="thumbAudio">
                            <input type="file" name="audio" class="layui-upload-audio">
                        </div>
                    </div>

                    <!--<div class="layui-form-item">-->
                    <!--<label class="layui-form-label">排行榜显示</label>-->
                    <!--<div class="layui-input-block">-->
                    <!--<input type="text" name="topNum" value="{$picture.topNum}" placeholder="请输入排行榜显示" autocomplete="off" class="layui-input">-->
                    <!--</div>-->
                    <!--</div>-->

                    <div class="layui-form-item">
                        <label class="layui-form-label">虚拟浏览量</label>
                        <div class="layui-input-block">
                            <input type="text" name="virtualNum" value="{$picture.virtualNum}" placeholder="真实浏览量+虚拟浏览量" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">虚拟参与量</label>
                        <div class="layui-input-block">
                            <input type="text" name="virtualPerson" value="{$picture.virtualPerson}" placeholder="真实参与人数+虚拟参与人数" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <input type="hidden" value="{$picture['id']}" name="id">
                            <button class="layui-btn" lay-submit lay-filter="*" type="submit">提交</button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="js"}
<script src="__JS__/ueditor/ueditor.config.js"></script>
<script src="__JS__/ueditor/ueditor.all.min.js"></script>
{/block}
{block name="script"}
<script>
    $(function() {
        var ue = UE.getEditor('content'),
            uploadEditor = UE.getEditor('upload-photo-btn'),
            photoListItem,
            uploadImage;

        uploadEditor.ready(function () {
            uploadEditor.setDisabled();
            uploadEditor.hide();
            uploadEditor.addListener('beforeInsertImage', function (t, arg) {
                $.each(arg, function (index, item) {
                    photoListItem = '<div class="photo-list"><input type="text" name="photo[]" value="' + item.src + '" class="layui-input layui-input-inline">';
                    photoListItem += '<button type="button" class="layui-btn layui-btn-danger remove-photo-btn">移除</button></div>';

                    $('#photo-container').append(photoListItem).on('click', '.remove-photo-btn', function () {
                        $(this).parent('.photo-list').remove();
                    });
                });
            });
        });

        $('#upload-photo-btn').on('click', function () {
            uploadImage = uploadEditor.getDialog("insertimage");
            uploadImage.open();
        });
    });
</script>
{/block}